#include "thread.hpp"
#include <unistd.h>
using namespace thread_module;

int a=1,b=1;
void fun()
{
    int cnt=5;
    while(cnt--)
    {
    int ret=a+b;
    a++;b++;
    printf("结果是%d\n",ret);
    sleep(1);
    }
}
int main()
{
    thread p1(fun);
    thread p2(fun);
    p1.start();
    p2.start();
    p2.detach();
    p1.join();
    p2.join();
    return 0;
}